<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="simpleServlet.ChartServlet" %>
<%@page import="org.jCharts.imageMap.*" %>
<%@page import="java.util.Iterator" %>
<jsp:include page="header.jsp" />
<div id="content">

	<form METHOD=POST ACTION="./LineServlet">
		Isin
		<%String isin = (String)request.getSession().getAttribute("isin");if(isin==null)isin="";%>
		<INPUT type=text name="isin" value="<%=isin%>"/>
		<input type="submit" VALUE="Validez">
	</form>
	<div>
	<img border="0" src="ChartServlet" useMap="#chartMap">
	</div>
	<a href="StockServlet">StockServlet</a>
	<a href="XYServlet">XYServlet</a>
	<map name="chartMap">
	
	<%
	StringBuffer html= new StringBuffer( 100 );
	ImageMap imageMap= (ImageMap) request.getAttribute( ChartServlet.IMAGE_MAP_LINECHART );
	
	Iterator iterator= imageMap.getIterator();
	while( iterator.hasNext() )
	{
		ImageMapArea imageMapArea= (ImageMapArea) iterator.next();
		
		html.append( "href=\"javascript:showValues(" );
		html.append( imageMapArea.getValue() );
		html.append( ",'" );
		html.append( imageMapArea.getLengendLabel() );
		html.append( "','" );
		html.append( imageMapArea.getXAxisLabel() );
		html.append( "');\"" );
	%>
		<%= 	imageMapArea.toHTML( html.toString() ) %>
	<% 
		//---reuse same StringBuffer Object
		html.delete( 0, html.length() );
	} 
	%>
	</map>

</div> <!-- close main content -->
<jsp:include page="footer.jsp" />